package dao;

import entity.FilmInfo;
import entity.FilmType;
import org.apache.ibatis.session.SqlSession;
import tool.MyBatisUtil;

import java.util.ArrayList;
import java.util.List;

public class FilmTypeDaoImpl implements FilmTypeDao{

    SqlSession sqlSession=null;


    @Override
    public FilmType getFilmTypeById(Integer typeid) {
        FilmType type = null;
        try{
            sqlSession = MyBatisUtil.getSession();
            type = sqlSession.getMapper(FilmTypeDao.class).getFilmTypeById(typeid);
            return type;

        }catch (Exception e){
            e.printStackTrace();
            return null;

        }finally {
            //释放资源
           MyBatisUtil.closeSession();
        }
    }
}
